﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HelpNetwork
{
    public partial class ConfigAplicatie : Form
    {
        public ConfigAplicatie()
        {
            InitializeComponent();
        }

        private void btnSalvare_Click(object sender, EventArgs e)
        {
            String host;
            if (txtAdresa.Text.Contains("http://") == false)
                txtAdresa.Text = String.Concat("http://",txtAdresa.Text);

            if (txtAdresa.Text.LastIndexOf('/') == (txtAdresa.Text.Length - 1))
                host = txtAdresa.Text.Remove(txtAdresa.Text.Length - 1);
            else
                host = txtAdresa.Text;
            Principal.mainForm.appParam.adresaDispecerat = host;
            Principal.mainForm.Enabled = true;
            this.Close();
        }

        private void cbAfisareMesajeStare_CheckedChanged(object sender, EventArgs e)
        {
            if (cbAfisareMesajeStare.Checked == true)
                Principal.mainForm.afisareMesajeStare();
            else
                Principal.mainForm.ascundeMesajeStare();
        }

        private void ConfigAplicatie_Load(object sender, EventArgs e)
        {
            if (Principal.mainForm.mesajeStareAscunse == false)
                cbAfisareMesajeStare.Checked = true;
        }
    }
}
